<template>
  <div class="content" v-if="type == 0">
    <div class="html" v-html="content"></div>
    <div class="button">
      <div class="buttons" @click="navTo(1)">同 意</div>
      <div class="buttons" style="margin-left: 20px" @click="router.go(-1)">
        不同意
      </div>
    </div>
  </div>
  <Form v-if="type == 1" @navTo="navTo(2)" />
  <Pay v-if="type == 2" />
</template>

<script>
import { defineComponent, ref } from "vue";
import { useRouter } from "vue-router";
import Form from "./components/Form";
import Pay from "./components/Pay";
import {} from "@/api/https.js";
export default defineComponent({
  setup() {
    const router = useRouter();
    const content = JSON.parse(localStorage.getItem("publicInfo")).baoming;
    const type = ref(0);
    const navTo = (index) => {
      type.value = index;
    };
    return {
      router,
      navTo,
      type,
      content,
    };
  },
  components: {
    Form,
    Pay,
  },
});
</script>

<style lang="less" scoped>
.content {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 40px;

  .html {
    padding: 20px 40px;
    max-height: 900px;
    overflow-x: hidden;
    overflow-y: scroll;
  }

  .button {
    text-align: center;
    font-size: var(--txtSize);
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;

    .buttons {
      border-radius: 25px;
      cursor: pointer;
      background-color: #554de5;
      width: 150px;
      height: 45px;
      line-height: 45px;
    }
  }
}
</style>
